package gtkwire.gobject;

import gtkwire.GTKWireCommand;

public class GtkListStore extends GtkTreeModel
{
	public GtkListStore( GType[] columnTypes )
	{
		super( GO_GtkListStore );
		this.columnTypes = columnTypes;
		String[] msg = new String[columnTypes.length];
		for( int i = 0; i< columnTypes.length; i++ )
			msg[i] = columnTypes[i].getCodeStr();
		createGObjectInstance( msg );
	}

	/**
	*
	*/
	public void setValue( GtkTreeRowIter iter, int columnIndex, Object value )
	{
		String addr = iter.getAddr();
		int[] idata = new int[3];
		idata[0] = columnIndex;
		idata[1] = columnTypes[columnIndex].getCode();
		idata[2] = id;
		String[] sdata = {
					addr,
					GType.getValString( columnTypes[columnIndex], value ) 
				 };

		app().sendCommand( MAGIC_NAME, GTKWireCommand.TW_LS_SET_VALUE, sdata, idata );
	}


	public void setIntValue( GtkTreeRow row, int column, int value )
	{
		setIntLS( id, row.getAddr(), column, value );
	}

	public void setStringValue( GtkTreeRow row, int column, String value )
	{
		setStringLS( id, row.getAddr(), column, value );
	}

	public void setBooleanValue( GtkTreeRow row, int column, boolean value )
	{
		setBooleanLS( id, row.getAddr(), column, value );
	}

	public void setGOjectValue( GtkTreeRow row, int column, GObject obj )
	{
		setGObjectLS( id, row.getAddr(), column, obj.getId());
	}

	public void setRowValues( GtkTreeRowIter iter, Object[] value )
	{

	}




	/**
	* 
	*/
	public void remove( GtkTreeIter iter )
	{

	}

	/**
	*
	*/
	public void insert( GtkTreeIter iter )
	{

	}

	/**
	*
	*/
	public void prepend()
	{

	}

	/**
	*
	*/
	public void append()
	{
		app().sendCommand( MAGIC_NAME, GTKWireCommand.TW_LS_APPEND, id);
	}

	/**
	*
	*/
	public void clear()
	{

	}

	/**
	*
	*/
	public void swap( GtkTreeIter a, GtkTreeIter b )
	{

	}

	/**
	*
	*/
	public void moveBefore( GtkTreeIter iter, GtkTreeIter position)
	{

	}

	/**
	*
	*/
	public void moveAfter( GtkTreeIter iter, GtkTreeIter position)
	{

	}

	/**
	*
	*/
	public void insertBefore( GtkTreeIter iter, GtkTreeIter position)
	{

	}

	/**
	*
	*/
	public void insertAfter( GtkTreeIter iter, GtkTreeIter position)
	{

	}

}//end class 